<?php session_start(); ?>
<?php include "libfunc.php";?>
<?php if (!empty($_SESSION['admUser']) && !empty($_SESSION['admPass'])) { ?>

<html>

 <body class="fix">
  <div id="wrapper">
   
	<div class="subTitleHeader">
	 - Website Administrator Control Panel -
	</div>
   </div>
   
	<div id="rightColumn">
	 <div class="content">
	  <fieldset>
          <legend>View Data Member</legend>
   <?php 
		  $file   = "view_member.php";
		  include "class_paging.php";
		  $p      = new Paging;
		  $batas  = 5;
		  $posisi = $p->cariPosisi($batas);
		
		  $link = koneksi_db();
		  $sql  = "select * from dtmember limit $posisi,$batas";
		  $res  = mysql_query($sql,$link);
		  $sql2 = "select * from dtmember";
		  $res2 =  mysql_query($sql2);
		  $jmlrecord = mysql_num_rows($res2);
		  $jmlhalaman = $p->jumlahHalaman($jmlrecord,$batas);
		
		if($jmlrecord > 0){
		?>
		<table align='center' class="tableView">
		  <tr class='trTable'>
		    <td>NO</td>
		   	<td>Nama</td>
			<td>Email</td>
			<td>Detail</td>
		  </tr>
	  <?php
	     $no = $posisi+1;
		 while( $data = mysql_fetch_array($res) ){
		   ?>
		   <tr>
		     <td><?php echo $no; ?></td>
			 <td><?php echo $data['nama']; ?></td>
			 <td><?php echo $data['email']; ?></td>
			 <td align="center"><a href="detail_member.php?id=<?php echo $data['id_member']; ?>"><img src="img/magnifier.png" border="0" title="Lihat !"></a></td>
		 <?php
		   $no++;
		 }
		 ?>
         </table><br><br>
         <span class="paging">
      <?php
	    $linkHalaman = $p->navHalaman($_GET[halaman],$jmlhalaman);
		echo $linkHalaman;
	  ?>
      	 </span>
		 </fieldset>
         <div id='keterangan'>
       		<fieldset>
         	<legend>Keterangan</legend>
         	Data Member,,Silakan Dilihat !!!
       		</fieldset>
     	 </div>
         <?php
	  }else{
	    echo "
			</table>
		 	</fieldset>
			<div id='keterangan'>
       		<fieldset>
         	<legend>Keterangan</legend>
         	Maaf Data Member Kosong !!!
       		</fieldset>
     		</div>
		";
	  }
	  ?>
	  
        
	 
     
  
 </body>
</html>
<?php
}else{
  echo "<script language='javascript'>alert('Silakan Sign In Terlebih Dahulu')</script>";
  echo "<script language='javascript'>window.location = '../admin/'</script>";
}